<template>
	<view class="pages">
		<!-- 顶部导航 -->
		<g-pages-tab class="pages-tab bgc-w" :list="pagesTab" :index='ptIndex' @change="changePagesTab" />
		<!-- 时间筛选 -->
		<p-time-tab class="bgc-w pl-30 pr-30" :list="timeTab" :index='timeIndex' v-if='ptIndex' />
		<!-- 综合 -->
		<view class="" v-if="ptIndex==0">
			<complexModules />
		</view>
		<!-- 交易 -->
		<view class="" v-if="ptIndex==1">
			<tradeModules />
		</view>
		<!-- 顾客 -->
		<view class="" v-if="ptIndex==2">
			<customerModules />
		</view>
		<!-- 社群 -->
		<view class="" v-if="ptIndex==3">
			<associationModules />
		</view>
		<!-- 技术支持 -->
		<p-support class=""></p-support>
	</view>
</template>

<script>
	import complexModules from './components/complexModules.vue'
	import tradeModules from './components/tradeModules.vue'
	import customerModules from './components/customerModules.vue'
	import associationModules from './components/associationModules.vue'

	export default {
		components: {
			complexModules,
			tradeModules,
			customerModules,
			associationModules,
		},
		data() {
			return {
				ptIndex: 0,
				timeIndex: 0
			};
		},
		methods: {
			changePagesTab(index) {
				this.ptIndex = index
			},

		},
		computed: {
			pagesTab() {
				return [{
					title: '综合'
				}, {
					title: '交易'
				}, {
					title: '顾客'
				}, {
					title: '社群'
				}]
			},
			timeTab() {
				return [{
						title: '今日'
					}, {
						title: '昨日'
					}, {
						title: '本月'
					},
					{
						title: '自定义'
					},
				]
			},
		}
	}
</script>

<style lang="scss" scoped>
	.pages-tab {
		height: 100rpx;
	}
</style>